Auto merge of #3336 - alexcrichton:fix-warning, r=brson
authorbors <bors@rust-lang.org>
Fri, 2 Dec 2016 03:20:54 +0000 (03:20 +0000)
committerbors <bors@rust-lang.org>
Fri, 2 Dec 2016 03:20:54 +0000 (03:20 +0000)
commitc99ae7e82cfe06a80712ad071c71a43bbc966728
tree566bb4867be5b940768c7748a6f6db06df776ea2
parentc82fd7f82b8cd3a846fa63d30d6b12d79ca2abe6
parent772e1a17b4e528c602d48002593726ebf6d126cf
Auto merge of #3336 - alexcrichton:fix-warning, r=brson

Test for bad path overrides with summaries

Bad path overrides are currently detected to issue warnings in cases where path
overrides are not suitable and have exhibited buggy behavior in the past.
Unfortunately though it looks like some false positives are being issued,
causing unnecessary confusion about `paths` overrides.

This commit fixes the detection of these "bad path overrides" by comparing
`Summary` dependencies (what's written down in `Cargo.toml`) rather than
comparing the `Cargo.toml` of the override with `Cargo.lock`. We're guaranteed
that the package we're overridding has already been resolved into `Cargo.lock`,
so we know that if the two `Cargo.toml` files are equivalent we'll continue
with the same crate graph.

I'm not actually entirely sure why I originally thought it'd be better to go
through the `Cargo.lock` comparison route. Unfortunately that doesn't take into
account optional deps which aren't in `Cargo.lock` but are in `Cargo.toml` of
the override, causing the false positive. This method, however, simply ensures
that the two dependency lists are the same.

Closes #3313